package com.wkbb.sports.dto;

import com.wkbb.sports.model.BaseEntity;
import com.wkbb.sports.model.HlifeWorkRule;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author lbh
 * @date 2021年03月29日 17:58:34
 * @description:   作业信息要求数据传输包装类
 */
@Data
public class HifeWorkDto extends BaseEntity {

    @ApiModelProperty(value = "项目ID")
    private Byte projectId;
    @ApiModelProperty(value = "是否需要实名认证")
    private Boolean faceRecognition;

    @ApiModelProperty(value = "项目名称")
    private String projectName;

    @ApiModelProperty(value = "学校ID")
    private Long orgId;

    @ApiModelProperty(value = "年级ID")
    private Long gradeId;

    @ApiModelProperty(value = "年级名称")
    private String gradeName;

    @ApiModelProperty(value = "班级ID")
    private Long classId;

    @ApiModelProperty(value = "班级名称")
    private String className;

    @ApiModelProperty(value = "教师ID")
    private Long teacherId;

    @ApiModelProperty(value = "教师名称")
    private String teacherName;

    @ApiModelProperty(value = "教师头像地址")
    private String headImgUrl;

    @ApiModelProperty(value = "开始时间")
    private Date beginTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "关联作业规则ID")
    private Integer ruleId;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "状态(0未开始 1进行中2已结束3已取消)")
    private Integer status;

    @ApiModelProperty(value = "作业要求")
    private HlifeWorkRule hlifeWorkRule;

    @ApiModelProperty(value = "选中的学生id列表(studentNo)")
    private List<String> studentIdList;  //也就是studentNo

    public static void main(String[] args) {
        HifeWorkDto hifeWorkDto=new HifeWorkDto();
//        hifeWorkDto.setStatus(4);
//        boolean bo=hifeWorkDto.getStatus() == null || !(hifeWorkDto.getStatus() == 0 ||hifeWorkDto.getStatus() == 1 ||hifeWorkDto.getStatus() == 2 ||hifeWorkDto.getStatus() == 3);
//        System.out.println(bo);


        boolean bo=verifyDate1("2020-08-09");
        System.out.println(bo);
    }



    public static boolean verifyDate1(String date){
//        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat sdf=new SimpleDateFormat("mm月-dd日");
        try {
            String result=sdf.format(sdf.parse(date));
            System.out.println("=========日期解析成功============result==："+result);
            return true;
        }catch (Exception e){
            System.out.println("=========日期解析失败=============");
        }
        return false;
    }


}
